package com.yc.bos.service.impl;

import com.yc.bos.dao.INoticebillDao;
import com.yc.bos.model.Decidedzone;
import com.yc.bos.model.Noticebill;
import com.yc.bos.model.Staff;
import com.yc.bos.service.INoticebillService;
import com.yc.bos.service.base.BaseServiceImpl;
import com.yc.bos.utils.BOSContextUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

@Service
@Transactional
public class NoticebillServiceImpl extends BaseServiceImpl<Noticebill> implements INoticebillService {
    @Autowired
    private INoticebillDao noticebillDao;

    @Override
    public void save(Noticebill entity, String decidedzoneId) {
        entity.setOrdertype("新增");
        entity.setUser(BOSContextUtils.loginUser());
        if (!StringUtils.isEmpty(decidedzoneId)) {
            Decidedzone dz = decidedzoneDao.findById(decidedzoneId);
            Staff staff = dz.getStaff();
            entity.setStaff(staff);
        }
        noticebillDao.save(entity);



    }

    @Override
    public void save(Noticebill entity) {

    }

    @Override
    public void update(Noticebill entity) {

    }

    @Override
    public void delete(Noticebill entity) {

    }

    @Override
    public Noticebill findById(Serializable id) {
        return null;
    }

    @Override
    public List<Noticebill> findAll() {
        return null;
    }
}
